home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-12-22 | 2.3 KB | 70 lines | [TEXT/MPS ] |
- OtherResInfo/MungeDeamon
- © 1992 Apple Computer.
- C.K. Haun
-
- The Problem:
- You want access to another resource fork, for some reason or other.
- Maybe you want to count resources, find something, duplicate something,
- or whatever.
-
- BUT
- Whenever you open someone else's resource fork, you run the following risks....
- 1) If the fork was already open, YOU can never close it, because you'll
- really mess up whomever needed it open (like a running app, nèh?).
- 2) The resources in that file could mess YOU up. You may pull
- the wrong dialog, icon, or (horrors) CODE resource out of the wrong
- fork. It's really nasty when you think you're executing your code
- and you're not, because the Segement Loader pulled CODE X out of
- the other resource fork, not yours.
-
- And there are other, subtle things that can mess up your mind when you suddenly
- have someone else's resource map in your chain, and you can't get rid of it.
-
- The Solution!
- Under 7.0 and later, there is a nice, neat, clean, and cute solution to this
- problem.
- Have someone else to the work for you!
-
- This sample demonstrates how to use a background-only application and
- AppleEvents to safely open and query another application's (or other file's)
- resource fork.
-
- The MungeDeamon background-only application included in this sample is a
- demonstration of how to do this.
-
-
- How It Works
-
- Launch OtherResInfo
-
- Select "Get Resource Info" from the "Resource Info" menu
-
- You'll be prompted for three things
- The resource type you're interested in
- The file you want to get this information from (can be a running app)
- Whether you want MungeDeamon to quit when it's done or not
-
- OtherResInfo will find and launch MungeDeamon
-
- OtherResInfo will send an AppleEvent to MungeDeamon asking for information
- on the resource type and file you requested.
-
- MungeDeamon will munge the information out of the file, and pack it all up
- and send it back to OtherResInfo
-
- OtherResInfo will, like, show you the info.
-
- MungeDeamon will either stay running or quit, depending on what you told it
- to do.
-
- You have all the information you need in your foreground app WITHOUT getting
- a strange resource map in your file that you can't get rid of.
-
- And this is just one of a myriad of examples of what you can do safely with
- a backgrounder that is harder with an 'all-in-one' app.
-
- Backgrounders Are So Cool
-
- C.K. Haun
- Apple DTS
- ALink: DEVSUPPORT